<template>
  <div class="about">
    <div>
      <van-checkbox-group v-model="result" ref="checkboxGroup" @change="tz()">
        <van-checkbox name="篮球">篮球</van-checkbox>
        <van-checkbox name="足球">足球</van-checkbox>
        <van-checkbox name="3">棒球</van-checkbox>
      </van-checkbox-group>
      <van-button type="primary" @click="checkAll">全选</van-button>
      <van-button type="info" @click="toggleAll">反选</van-button>
    </div>
  </div>
</template>
<script>
export default{
  name: "AboutView",
  data(){
    return{
      result:[]
      }
    },
  methods:{
    checkAll() {
      this.$refs.checkboxGroup.toggleAll(true);
    },
    toggleAll() {
      this.$refs.checkboxGroup.toggleAll();
    },
    tz(){
      console.log(this.result)
    }
  }

}
</script>